import request from '@/config/axios'

export interface CertificationInfoVO {
  id: number
  userId: number
  certificationStatus: string
  realName: string
  idCardNo: string
  idCardFaceImg: string
  idCardNationalEmblemImg: string
  licenseNo: string
  licenseImg: string
  bankCardNo: string
  bankCardImg: string
}

export interface CertificationInfoAuditVO {
  id: number
  certificationStatus: string
  rejectReason: string
}

// 查询会员认证信息分页
export const getCertificationInfoPage = async (params) => {
  return await request.get({ url: `/member/certification-info/page`, params })
}

// 查询会员认证信息详情
export const getCertificationInfo = async (id: number) => {
  return await request.get({ url: `/member/certification-info/get?id=` + id })
}

// 新增会员认证信息
export const createCertificationInfo = async (data: CertificationInfoVO) => {
  return await request.post({ url: `/member/certification-info/create`, data })
}

// 修改会员认证信息
export const updateCertificationInfo = async (data: CertificationInfoVO) => {
  return await request.put({ url: `/member/certification-info/update`, data })
}

// 删除会员认证信息
export const deleteCertificationInfo = async (id: number) => {
  return await request.delete({ url: `/member/certification-info/delete?id=` + id })
}

// 导出会员认证信息 Excel
export const exportCertificationInfo = async (params) => {
  return await request.download({ url: `/member/certification-info/export-excel`, params })
}

// 审核会员认证信息
export const auditCertificationInfo = async (data: CertificationInfoAuditVO) => {
  return await request.put({ url: `/member/certification-info/audit`, data })
}
